package com.cc8w.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


/**
 * 网站首页
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/home/index")
public class IndexController extends BaseController {
	
	@ModelAttribute("attributeName")
	public String addAccount(HttpServletRequest request) {
		System.out.println("每次请求都执行");
		return "";
	}

	/**
	 * 首页方法  
	 */
	@RequestMapping("/index")
	public String index() {
		
		HttpServletRequest req = this.request;
		HttpServletResponse resp= this.response;
		System.out.println(req);
		System.out.println(resp);
		System.out.println("home/index/index");
		
        this.model.addAttribute("user", "111--123");
		this.model.addAttribute("test02", "家里电脑添加的变量-专门制造git冲突.");
        this.model.addAttribute("test01", "idea第二次修改indexController");
		this.model.addAttribute("test04", "idea公司电脑第四次修改indexController,制造冲突,");
        //这是解决了冲入后的结果result文件
		//又再公司解决了第四次冲突
        return "home/index/index";
	}
	
	@RequestMapping("/list")
	public String list() {
	
		
		
		return "home/index/list";	
	}

}
